<table class="table table-bordered" style="margin-top: 0px;">
    <thead>
        <tr>
            <th width="8%">拍卖单号</th>
            <th width="15%">车型</th>
            <th width="6%">所在地</th>
            <th width="8%">车商联系人</th>
            <th width="10%">联系人电话</th>
            <if condition="($status==2 || $status==3 || $status==4)">
                <th width="8%">付款类型</th>
                <th width="8%">收款状态</th>
            </if>
            <if condition="($status==1)"><th width="12%">创建时间</th></if>
            <if condition="($status==2 || $status==3)"><th width="12%">结算时间</th></if>
            <if condition="($status==4)"><th width="12%">违约时间</th></if>
            <if condition="($status==5)">
                <th width="8%">付款类型</th>
                <th width="12%">付款时间</th>
            </if>
            <if condition="($status==1 || $status==2 || $status==3 || $status==4)">
            <th width="8%">操作</th>
            </if>
        </tr>
    </thead>
    <tbody>
    <foreach name="list" item="row">
        <tr>
            <td>{$row.order_no}</td>
            <td><a href="/Car/report/car_id/{$row.car_id}" target="_blank">{$row.car_model}</a></td>
            <td>{$row.location_area_str}</td>
            <td>{$row.contact_person}</td>
            <td>{$row.contact_mobile}</td>
            <if condition="($status==2 || $status==3 || $status==4)">
                <td><if condition="$row.dealer_pay_mode eq 1">全款<elseif condition="$row.dealer_pay_mode eq 2" />贷款<else/>--</if></td>
                <td>{$row.collection_status_name}</td>
            </if>
            <if condition="($status==1)">
                <td>{$row.createtime}</td>
            </if>
            <if condition="($status==2 || $status==3)">
                <td>{$row.settlement_time}</td>
            </if>
            <if condition="($status==4)">
                <td>{$row.violatetime}</td>
            </if>
            <if condition="($status==5)">
                <td><if condition="$row.dealer_pay_mode eq 1">全款<elseif condition="$row.dealer_pay_mode eq 2" />贷款<else/>--</if></td>
                <td>{$row.pay_time}</td>
            </if>
            <if condition="($status==1 || $status==2 || $status==3)">
                <td>
                  <?php if($row['is_lock']==1):?>
                    <a href="javascript:void(0)" style="color:#7f7f7f;" >跟踪</a>
                  <?php else:?>
                    <a href="/PayTrack/dealer_pay_track/id/{$row.order_id}" target="_blank" >跟踪</a>

                  <?php endif;?>
                    <?php if ($row['is_again_void']): ?>
                        <a href="javascript:" onclick="violate({$row.order_id})">违约</a>
                    <?php endif ?>
                    <else/>
                </td>
            </if>
            <if condition="($status==4)">
                <td>
                    <a href="/PayTrack/pay_info/order_id/{$row.order_id}" target="_blank" >查看</a>
                </td>
            </if>
        </tr>
    </foreach>
    </tbody>
</table>
<!--违约-->
<div class="chenggong1">
    <span class="paidan">您确定要置为违约吗?</span>
    <div class="shenhei-btn">
        <input type="hidden" name="order_id"  value="" />
        <input type="button" value="确定" class="determine" />
        <input type="button" value="取消" class="cancel" />
    </div>
</div>
<div class="yunBei"></div>
<div class="error msg" style="color: red; text-align:left;">{$errMsg}</div>
<div class="pageFaye"><div class="pager">{$page}</div><div class="clear"></div></div>
<script type="text/javascript">$(function(){$("input").placeholder();});</script>

<script>
    function violate(order_id){
        $('.chenggong1').css('display', 'block');
        $('.yunBei').css({'display':'block',"zIndex":999});
        $('input[name=order_id]').val(order_id);
    }
    $(".determine").on('click', function () {
        var order_id = $('input[name=order_id]').val();
        var param = {
            'order_id':order_id
        };
        var btn_obj = $(this);
        btn_obj.val("提交中...").attr("disabled",'disabled');
        $.post('/PayTrack/violate', param, function (data) {
            if (data.code == '200') {
                btn_alert(data.msg);
                $('.chenggong1').fadeOut();
                btn_obj.val("确定").removeAttr("disabled style");
                setTimeout(function () {
                        window.location.reload();
                    }, 500);
            } else {
                shibai_alert(data.msg)
                btn_obj.val("确定").removeAttr("disabled style");
                $('.chenggong1').fadeOut();
            }
            $('.yunBei').css({'display':'none',"zIndex":999});
        }, 'json');
    });
    $(".cancel").on('click', function () {
        $('.chenggong1').fadeOut();
        $('.yunBei').css({'display':'none',"zIndex":999});
    });
</script>